package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.searchusers;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.ResetButtonListener;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.core.Position;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.layout.FitLayout;

/**
 * @author Renato Miceli
 */
public class SearchUsersInnerPanel extends Panel {

	public SearchUsersInnerPanel(TabPanel centerPanel, InfoManager<UserInfo> infoManager) {

		this.setLayout(new FitLayout());
		this.setAutoScroll(true);
		this.setButtonAlign(Position.CENTER);
		this.setPaddings(15);

		final SearchUsersFormPanel searchPanel = new SearchUsersFormPanel();

		this.addButton(new Button("Search", new SearchButtonListener(searchPanel, centerPanel, infoManager)));
		this.addButton(new Button("Clear", new ResetButtonListener(searchPanel)));
		this.add(searchPanel);
	}

}